(0) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

ap(ap(f, x), x) → ap(ap(x, ap(f, x)), ap(ap(cons, x), nil))
ap(ap(ap(foldr, g), h), nil) → h
ap(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → ap(ap(g, x), ap(ap(ap(foldr, g), h), xs))

Q is empty.

(1) Overlay + Local Confluence (EQUIVALENT transformation)

The TRS is overlay and locally confluent. By [NOC] we can switch to innermost.

(2) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

ap(ap(f, x), x) → ap(ap(x, ap(f, x)), ap(ap(cons, x), nil))
ap(ap(ap(foldr, g), h), nil) → h
ap(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → ap(ap(g, x), ap(ap(ap(foldr, g), h), xs))

The set Q consists of the following terms:

ap(ap(f, x0), x0)
ap(ap(ap(foldr, x0), x1), nil)
ap(ap(ap(foldr, x0), x1), ap(ap(cons, x2), x3))

(3) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.

(4) Obligation:

Q DP problem:
The TRS P consists of the following rules:

AP(ap(f, x), x) → AP(ap(x, ap(f, x)), ap(ap(cons, x), nil))
AP(ap(f, x), x) → AP(x, ap(f, x))
AP(ap(f, x), x) → AP(ap(cons, x), nil)
AP(ap(f, x), x) → AP(cons, x)
AP(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → AP(ap(g, x), ap(ap(ap(foldr, g), h), xs))
AP(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → AP(g, x)
AP(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → AP(ap(ap(foldr, g), h), xs)

The TRS R consists of the following rules:

ap(ap(f, x), x) → ap(ap(x, ap(f, x)), ap(ap(cons, x), nil))
ap(ap(ap(foldr, g), h), nil) → h
ap(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → ap(ap(g, x), ap(ap(ap(foldr, g), h), xs))

The set Q consists of the following terms:

ap(ap(f, x0), x0)
ap(ap(ap(foldr, x0), x1), nil)
ap(ap(ap(foldr, x0), x1), ap(ap(cons, x2), x3))

We have to consider all minimal (P,Q,R)-chains.

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 3 less nodes.

(6) Obligation:

Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → AP(ap(g, x), ap(ap(ap(foldr, g), h), xs))
AP(ap(f, x), x) → AP(ap(x, ap(f, x)), ap(ap(cons, x), nil))
AP(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → AP(g, x)
AP(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → AP(ap(ap(foldr, g), h), xs)

The TRS R consists of the following rules:

ap(ap(f, x), x) → ap(ap(x, ap(f, x)), ap(ap(cons, x), nil))
ap(ap(ap(foldr, g), h), nil) → h
ap(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → ap(ap(g, x), ap(ap(ap(foldr, g), h), xs))

The set Q consists of the following terms:

ap(ap(f, x0), x0)
ap(ap(ap(foldr, x0), x1), nil)
ap(ap(ap(foldr, x0), x1), ap(ap(cons, x2), x3))

We have to consider all minimal (P,Q,R)-chains.

(7) ForwardInstantiation (EQUIVALENT transformation)

By forward instantiating [JAR06] the rule AP(ap(f, x), x) → AP(ap(x, ap(f, x)), ap(ap(cons, x), nil)) we obtained the following new rules [LPAR04]:

AP(ap(f, ap(foldr, y_0)), ap(foldr, y_0)) → AP(ap(ap(foldr, y_0), ap(f, ap(foldr, y_0))), ap(ap(cons, ap(foldr, y_0)), nil))

(8) Obligation:

Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → AP(ap(g, x), ap(ap(ap(foldr, g), h), xs))
AP(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → AP(g, x)
AP(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → AP(ap(ap(foldr, g), h), xs)
AP(ap(f, ap(foldr, y_0)), ap(foldr, y_0)) → AP(ap(ap(foldr, y_0), ap(f, ap(foldr, y_0))), ap(ap(cons, ap(foldr, y_0)), nil))

The TRS R consists of the following rules:

ap(ap(f, x), x) → ap(ap(x, ap(f, x)), ap(ap(cons, x), nil))
ap(ap(ap(foldr, g), h), nil) → h
ap(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → ap(ap(g, x), ap(ap(ap(foldr, g), h), xs))

The set Q consists of the following terms:

ap(ap(f, x0), x0)
ap(ap(ap(foldr, x0), x1), nil)
ap(ap(ap(foldr, x0), x1), ap(ap(cons, x2), x3))

We have to consider all minimal (P,Q,R)-chains.

(9) Narrowing (EQUIVALENT transformation)

By narrowing [LPAR04] the rule AP(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → AP(ap(g, x), ap(ap(ap(foldr, g), h), xs)) at position [1] we obtained the following new rules [LPAR04]:

AP(ap(ap(foldr, x0), x1), ap(ap(cons, y2), nil)) → AP(ap(x0, y2), x1)
AP(ap(ap(foldr, x0), x1), ap(ap(cons, y2), ap(ap(cons, x2), x3))) → AP(ap(x0, y2), ap(ap(x0, x2), ap(ap(ap(foldr, x0), x1), x3)))

(10) Obligation:

Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → AP(g, x)
AP(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → AP(ap(ap(foldr, g), h), xs)
AP(ap(f, ap(foldr, y_0)), ap(foldr, y_0)) → AP(ap(ap(foldr, y_0), ap(f, ap(foldr, y_0))), ap(ap(cons, ap(foldr, y_0)), nil))
AP(ap(ap(foldr, x0), x1), ap(ap(cons, y2), nil)) → AP(ap(x0, y2), x1)
AP(ap(ap(foldr, x0), x1), ap(ap(cons, y2), ap(ap(cons, x2), x3))) → AP(ap(x0, y2), ap(ap(x0, x2), ap(ap(ap(foldr, x0), x1), x3)))

The TRS R consists of the following rules:

ap(ap(f, x), x) → ap(ap(x, ap(f, x)), ap(ap(cons, x), nil))
ap(ap(ap(foldr, g), h), nil) → h
ap(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → ap(ap(g, x), ap(ap(ap(foldr, g), h), xs))

The set Q consists of the following terms:

ap(ap(f, x0), x0)
ap(ap(ap(foldr, x0), x1), nil)
ap(ap(ap(foldr, x0), x1), ap(ap(cons, x2), x3))

We have to consider all minimal (P,Q,R)-chains.

(11) ForwardInstantiation (EQUIVALENT transformation)

By forward instantiating [JAR06] the rule AP(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → AP(g, x) we obtained the following new rules [LPAR04]:

AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_2), y_3)), x3)) → AP(ap(ap(foldr, y_0), y_1), ap(ap(cons, y_2), y_3))
AP(ap(ap(foldr, ap(f, ap(foldr, y_0))), x1), ap(ap(cons, ap(foldr, y_1)), x3)) → AP(ap(f, ap(foldr, y_0)), ap(foldr, y_1))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_2), nil)), x3)) → AP(ap(ap(foldr, y_0), y_1), ap(ap(cons, y_2), nil))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_2), ap(ap(cons, y_3), y_4))), x3)) → AP(ap(ap(foldr, y_0), y_1), ap(ap(cons, y_2), ap(ap(cons, y_3), y_4)))

(12) Obligation:

Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → AP(ap(ap(foldr, g), h), xs)
AP(ap(f, ap(foldr, y_0)), ap(foldr, y_0)) → AP(ap(ap(foldr, y_0), ap(f, ap(foldr, y_0))), ap(ap(cons, ap(foldr, y_0)), nil))
AP(ap(ap(foldr, x0), x1), ap(ap(cons, y2), nil)) → AP(ap(x0, y2), x1)
AP(ap(ap(foldr, x0), x1), ap(ap(cons, y2), ap(ap(cons, x2), x3))) → AP(ap(x0, y2), ap(ap(x0, x2), ap(ap(ap(foldr, x0), x1), x3)))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_2), y_3)), x3)) → AP(ap(ap(foldr, y_0), y_1), ap(ap(cons, y_2), y_3))
AP(ap(ap(foldr, ap(f, ap(foldr, y_0))), x1), ap(ap(cons, ap(foldr, y_1)), x3)) → AP(ap(f, ap(foldr, y_0)), ap(foldr, y_1))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_2), nil)), x3)) → AP(ap(ap(foldr, y_0), y_1), ap(ap(cons, y_2), nil))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_2), ap(ap(cons, y_3), y_4))), x3)) → AP(ap(ap(foldr, y_0), y_1), ap(ap(cons, y_2), ap(ap(cons, y_3), y_4)))

The TRS R consists of the following rules:

ap(ap(f, x), x) → ap(ap(x, ap(f, x)), ap(ap(cons, x), nil))
ap(ap(ap(foldr, g), h), nil) → h
ap(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → ap(ap(g, x), ap(ap(ap(foldr, g), h), xs))

The set Q consists of the following terms:

ap(ap(f, x0), x0)
ap(ap(ap(foldr, x0), x1), nil)
ap(ap(ap(foldr, x0), x1), ap(ap(cons, x2), x3))

We have to consider all minimal (P,Q,R)-chains.

(13) ForwardInstantiation (EQUIVALENT transformation)

By forward instantiating [JAR06] the rule AP(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → AP(ap(ap(foldr, g), h), xs) we obtained the following new rules [LPAR04]:

AP(ap(ap(foldr, x0), x1), ap(ap(cons, x2), ap(ap(cons, y_2), y_3))) → AP(ap(ap(foldr, x0), x1), ap(ap(cons, y_2), y_3))
AP(ap(ap(foldr, x0), x1), ap(ap(cons, x2), ap(ap(cons, y_2), nil))) → AP(ap(ap(foldr, x0), x1), ap(ap(cons, y_2), nil))
AP(ap(ap(foldr, x0), x1), ap(ap(cons, x2), ap(ap(cons, y_2), ap(ap(cons, y_3), y_4)))) → AP(ap(ap(foldr, x0), x1), ap(ap(cons, y_2), ap(ap(cons, y_3), y_4)))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, x2), ap(ap(cons, ap(ap(cons, y_3), y_4)), y_5))) → AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_3), y_4)), y_5))
AP(ap(ap(foldr, ap(f, ap(foldr, y_0))), x1), ap(ap(cons, x2), ap(ap(cons, ap(foldr, y_2)), y_3))) → AP(ap(ap(foldr, ap(f, ap(foldr, y_0))), x1), ap(ap(cons, ap(foldr, y_2)), y_3))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, x2), ap(ap(cons, ap(ap(cons, y_3), nil)), y_4))) → AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_3), nil)), y_4))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, x2), ap(ap(cons, ap(ap(cons, y_3), ap(ap(cons, y_4), y_5))), y_6))) → AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_3), ap(ap(cons, y_4), y_5))), y_6))

(14) Obligation:

Q DP problem:
The TRS P consists of the following rules:

AP(ap(f, ap(foldr, y_0)), ap(foldr, y_0)) → AP(ap(ap(foldr, y_0), ap(f, ap(foldr, y_0))), ap(ap(cons, ap(foldr, y_0)), nil))
AP(ap(ap(foldr, x0), x1), ap(ap(cons, y2), nil)) → AP(ap(x0, y2), x1)
AP(ap(ap(foldr, x0), x1), ap(ap(cons, y2), ap(ap(cons, x2), x3))) → AP(ap(x0, y2), ap(ap(x0, x2), ap(ap(ap(foldr, x0), x1), x3)))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_2), y_3)), x3)) → AP(ap(ap(foldr, y_0), y_1), ap(ap(cons, y_2), y_3))
AP(ap(ap(foldr, ap(f, ap(foldr, y_0))), x1), ap(ap(cons, ap(foldr, y_1)), x3)) → AP(ap(f, ap(foldr, y_0)), ap(foldr, y_1))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_2), nil)), x3)) → AP(ap(ap(foldr, y_0), y_1), ap(ap(cons, y_2), nil))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_2), ap(ap(cons, y_3), y_4))), x3)) → AP(ap(ap(foldr, y_0), y_1), ap(ap(cons, y_2), ap(ap(cons, y_3), y_4)))
AP(ap(ap(foldr, x0), x1), ap(ap(cons, x2), ap(ap(cons, y_2), y_3))) → AP(ap(ap(foldr, x0), x1), ap(ap(cons, y_2), y_3))
AP(ap(ap(foldr, x0), x1), ap(ap(cons, x2), ap(ap(cons, y_2), nil))) → AP(ap(ap(foldr, x0), x1), ap(ap(cons, y_2), nil))
AP(ap(ap(foldr, x0), x1), ap(ap(cons, x2), ap(ap(cons, y_2), ap(ap(cons, y_3), y_4)))) → AP(ap(ap(foldr, x0), x1), ap(ap(cons, y_2), ap(ap(cons, y_3), y_4)))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, x2), ap(ap(cons, ap(ap(cons, y_3), y_4)), y_5))) → AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_3), y_4)), y_5))
AP(ap(ap(foldr, ap(f, ap(foldr, y_0))), x1), ap(ap(cons, x2), ap(ap(cons, ap(foldr, y_2)), y_3))) → AP(ap(ap(foldr, ap(f, ap(foldr, y_0))), x1), ap(ap(cons, ap(foldr, y_2)), y_3))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, x2), ap(ap(cons, ap(ap(cons, y_3), nil)), y_4))) → AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_3), nil)), y_4))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, x2), ap(ap(cons, ap(ap(cons, y_3), ap(ap(cons, y_4), y_5))), y_6))) → AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_3), ap(ap(cons, y_4), y_5))), y_6))

The TRS R consists of the following rules:

ap(ap(f, x), x) → ap(ap(x, ap(f, x)), ap(ap(cons, x), nil))
ap(ap(ap(foldr, g), h), nil) → h
ap(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → ap(ap(g, x), ap(ap(ap(foldr, g), h), xs))

The set Q consists of the following terms:

ap(ap(f, x0), x0)
ap(ap(ap(foldr, x0), x1), nil)
ap(ap(ap(foldr, x0), x1), ap(ap(cons, x2), x3))

We have to consider all minimal (P,Q,R)-chains.

(15) MNOCProof (EQUIVALENT transformation)

We use the modular non-overlap check [FROCOS05] to decrease Q to the empty set.

(16) Obligation:

Q DP problem:
The TRS P consists of the following rules:

AP(ap(f, ap(foldr, y_0)), ap(foldr, y_0)) → AP(ap(ap(foldr, y_0), ap(f, ap(foldr, y_0))), ap(ap(cons, ap(foldr, y_0)), nil))
AP(ap(ap(foldr, x0), x1), ap(ap(cons, y2), nil)) → AP(ap(x0, y2), x1)
AP(ap(ap(foldr, x0), x1), ap(ap(cons, y2), ap(ap(cons, x2), x3))) → AP(ap(x0, y2), ap(ap(x0, x2), ap(ap(ap(foldr, x0), x1), x3)))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_2), y_3)), x3)) → AP(ap(ap(foldr, y_0), y_1), ap(ap(cons, y_2), y_3))
AP(ap(ap(foldr, ap(f, ap(foldr, y_0))), x1), ap(ap(cons, ap(foldr, y_1)), x3)) → AP(ap(f, ap(foldr, y_0)), ap(foldr, y_1))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_2), nil)), x3)) → AP(ap(ap(foldr, y_0), y_1), ap(ap(cons, y_2), nil))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_2), ap(ap(cons, y_3), y_4))), x3)) → AP(ap(ap(foldr, y_0), y_1), ap(ap(cons, y_2), ap(ap(cons, y_3), y_4)))
AP(ap(ap(foldr, x0), x1), ap(ap(cons, x2), ap(ap(cons, y_2), y_3))) → AP(ap(ap(foldr, x0), x1), ap(ap(cons, y_2), y_3))
AP(ap(ap(foldr, x0), x1), ap(ap(cons, x2), ap(ap(cons, y_2), nil))) → AP(ap(ap(foldr, x0), x1), ap(ap(cons, y_2), nil))
AP(ap(ap(foldr, x0), x1), ap(ap(cons, x2), ap(ap(cons, y_2), ap(ap(cons, y_3), y_4)))) → AP(ap(ap(foldr, x0), x1), ap(ap(cons, y_2), ap(ap(cons, y_3), y_4)))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, x2), ap(ap(cons, ap(ap(cons, y_3), y_4)), y_5))) → AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_3), y_4)), y_5))
AP(ap(ap(foldr, ap(f, ap(foldr, y_0))), x1), ap(ap(cons, x2), ap(ap(cons, ap(foldr, y_2)), y_3))) → AP(ap(ap(foldr, ap(f, ap(foldr, y_0))), x1), ap(ap(cons, ap(foldr, y_2)), y_3))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, x2), ap(ap(cons, ap(ap(cons, y_3), nil)), y_4))) → AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_3), nil)), y_4))
AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, x2), ap(ap(cons, ap(ap(cons, y_3), ap(ap(cons, y_4), y_5))), y_6))) → AP(ap(ap(foldr, ap(ap(foldr, y_0), y_1)), x1), ap(ap(cons, ap(ap(cons, y_3), ap(ap(cons, y_4), y_5))), y_6))

The TRS R consists of the following rules:

ap(ap(f, x), x) → ap(ap(x, ap(f, x)), ap(ap(cons, x), nil))
ap(ap(ap(foldr, g), h), nil) → h
ap(ap(ap(foldr, g), h), ap(ap(cons, x), xs)) → ap(ap(g, x), ap(ap(ap(foldr, g), h), xs))

Q is empty.
We have to consider all (P,Q,R)-chains.

(17) NonTerminationProof (EQUIVALENT transformation)

We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

s = AP(ap(ap(f, foldr), foldr), ap(ap(cons, y2), nil)) evaluates to t =AP(ap(ap(f, foldr), y2), ap(ap(cons, foldr), nil))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
  • Matcher: [ ]
  • Semiunifier: [y2 / foldr]




Rewriting sequence

AP(ap(ap(f, foldr), foldr), ap(ap(cons, foldr), nil))AP(ap(ap(foldr, ap(f, foldr)), ap(ap(cons, foldr), nil)), ap(ap(cons, foldr), nil))
with rule ap(ap(f, x), x) → ap(ap(x, ap(f, x)), ap(ap(cons, x), nil)) at position [0] and matcher [x / foldr]

AP(ap(ap(foldr, ap(f, foldr)), ap(ap(cons, foldr), nil)), ap(ap(cons, foldr), nil))AP(ap(ap(f, foldr), foldr), ap(ap(cons, foldr), nil))
with rule AP(ap(ap(foldr, x0), x1), ap(ap(cons, y2), nil)) → AP(ap(x0, y2), x1)

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.



(18) NO